package com.ruoyi.project.mtool.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.mtool.mapper.RequirementMapper;
import com.ruoyi.project.mtool.domain.Requirement;
import com.ruoyi.project.mtool.service.IRequirementService;

/**
 * 需求记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-04-08
 */
@Service
public class RequirementServiceImpl implements IRequirementService 
{
    @Autowired
    private RequirementMapper requirementMapper;

    /**
     * 查询需求记录
     * 
     * @param requirementId 需求记录ID
     * @return 需求记录
     */
    @Override
    public Requirement selectRequirementById(Long requirementId)
    {
        return requirementMapper.selectRequirementById(requirementId);
    }

    /**
     * 查询需求记录列表
     * 
     * @param requirement 需求记录
     * @return 需求记录
     */
    @Override
    public List<Requirement> selectRequirementList(Requirement requirement)
    {
        return requirementMapper.selectRequirementList(requirement);
    }

    /**
     * 新增需求记录
     * 
     * @param requirement 需求记录
     * @return 结果
     */
    @Override
    public int insertRequirement(Requirement requirement)
    {
        requirement.setCreateTime(DateUtils.getNowDate());
        return requirementMapper.insertRequirement(requirement);
    }

    /**
     * 修改需求记录
     * 
     * @param requirement 需求记录
     * @return 结果
     */
    @Override
    public int updateRequirement(Requirement requirement)
    {
        requirement.setUpdateTime(DateUtils.getNowDate());
        return requirementMapper.updateRequirement(requirement);
    }

    /**
     * 批量删除需求记录
     * 
     * @param requirementIds 需要删除的需求记录ID
     * @return 结果
     */
    @Override
    public int deleteRequirementByIds(Long[] requirementIds)
    {
        return requirementMapper.deleteRequirementByIds(requirementIds);
    }

    /**
     * 删除需求记录信息
     * 
     * @param requirementId 需求记录ID
     * @return 结果
     */
    @Override
    public int deleteRequirementById(Long requirementId)
    {
        return requirementMapper.deleteRequirementById(requirementId);
    }
}
